|
![](/i/fill.gif) |
"Bob Hughes" <omniverse charter net> wrote:
> "Chris B" <nom### [at] nomail com> wrote in message
> news:4904fb3a@news.povray.org...
> >
> >>> I want to apply a color map to a torus so that the maps are applied as
> >>> wedges
> >>> when viewing a cross-section of the torus.
> >>> (I think this would be radially, but I am unsure.)
> >
> > To give you a pattern like a pie chart on the twin circular sections
> > through the torus, the only way I can think of is to build it up using
> > cone objects for textures rather than a color map. (I tried experimenting
> > with toroidal warp of a gradient and a radial texture, but failed to get
> > anything that mapped a color map in that way).
>
>
> Interesting solution, if this is the thing being asked for.
> Yeah, when I saw this message post I was going to try radial, then warp it,
> just to see if it could be done the way I figured would work right and it
> only gets nearly there:
>
> // BEGIN wedges in torus cutaway
> camera {
> location -3*z
> look_at 0
> rotate <30,0,0>
> }
>
> light_source {
> -99*z,
> 1
> rotate <60,45,0>
> }
>
> difference {
> torus {
> 1,0.5
> }
> plane {
> x,0
> rotate -90*y
> }
> texture {
> pigment {
> radial frequency 40
> color_map {
> [0.5 rgb 0.1]
> [0.5 rgb 0.9]
> }
> rotate 90*z
> warp {
> toroidal orientation y dist_exp 1 major_radius 1
> }
> } // pigment
> }
> }
> // END
>
> For reasons unknown to me the pattern doesn't have the symmetry I expected.
> Maybe somebody out there understands why not...?
>
> Bob H.
Hi Guys,
So far, Bob got the idea of what I was looking for, but I still have one
concern.
I want to control how many sections there are, it seems to be related to
"radial frequency 30" and maybe the number of entries in the color_map.
Any suggestions on understanding this?
FYI,
I want to make some areas of the cross-section transparent (hence the rgbt).
I want to be able to animate the rotation of the colors around the section. That
seems controllable e.g. "rotate x * frame_number"
Fwiw Here's my version based on Bob's code:
// BEGIN wedges in torus cutaway
camera {
location -3*z
look_at 0
// rotate <30,0,0>
}
sky_sphere {
pigment {
gradient y
color_map {
[0.0 rgb <0.6,0.7,1.0>]
[0.7 rgb <0.0,0.1,0.8>]
}
}
}
light_source {
-10*z,
1
//rotate <60,45,0>
}
light_source {
<0, 0, 0> // light's position (translated below)
color rgb <1, 1, 1> // light's color
translate <-30, 30, -30>
}
difference {
torus {
1,0.5
}
torus {
1,0.45
}
plane {
x,0
rotate -90*y
}
texture {
pigment {
radial frequency 30
color_map {
[0.25 color rgb <1,0,0>]
[0.50 color rgb <0,1,0>]
// [0.50 color rgbt <0,0,1>]
[0.75 color rgbt <0,0,1,1>]
[1.00 color rgbt <1,1,1>]
[1.00 color rgbt <1,1,1>]
}
rotate 90*z
rotate x * frame_number
warp {
toroidal orientation y dist_exp 1 major_radius 1
}
} // pigment
}
}
// END
Post a reply to this message
|
![](/i/fill.gif) |